package com.sy.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zbbstart
 * @date 2021/1/30 - 17:26
 */
@RestController
@RequestMapping("test")
public class TestController {
    //注入密码加密器
    @Autowired
    private PasswordEncoder encoder;

    @GetMapping("test01")
    public void test01(){
        String admin = encoder.encode("admin");
        System.out.println(admin);
    }
}
